package FrequentItemSetMining;
import java.util.ArrayList;
import java.util.HashMap;


public class Transaction {
	private HashMap<Integer, Item> items;

	public Transaction() {
		items = new HashMap<Integer, Item>();
	}
	
	public void addItem(Integer id) {
		Item toAdd = GlobalItemList.getInstance().getItem(id);
		items.put(id, toAdd);		
	}

	public void printAllItems() {
		for(Item i:items.values()) {
			System.out.println("Item" + i.getId());
		}
		
	}

	public boolean containsAll(ArrayList<Item> itemSet) {
		for(Item i:itemSet) {
			if(!items.containsKey(i.getId())) {
				return false;
			}
		}
		return true;
	}
}
